<template>
  <swiper ref="mySwiper" v-if="images.length>0" class="swiper" :options="swiperOptions">
    <swiper-slide v-for="(item,index) of images" :key="index">
      <img class="swiper-item" :src="item.fileUrl | actualurl" alt="图片">
    </swiper-slide>
    <div class="swiper-pagination" slot="pagination"></div>
  </swiper>
</template>

<script>
  import {
    Swiper,
    SwiperSlide
  } from 'vue-awesome-swiper'
  import 'swiper/swiper-bundle.css'

  export default {
    data() {
      return {
        swiperOptions: {
          centeredSlides: true,
          autoplay: {
            delay: 1500,
            disableOnInteraction: false
          },
          loop: true,
          isLoad: false
        }
      }
    },
    components: {
      Swiper,
      SwiperSlide
    },
    props: {
      images: {
        // type: Array,
        default() {
          return []
        }
      }
    },
    filters: {
      actualurl(value) {
        return "http://dev.api.sqiandai.com" + value;
      },
      tomoney(value) {
        return "$ " + value
      }
    }
  }
</script>

<style scoped="scoped">
  .swiper{
    height: 250px;
  }
  .swiper-item{
    height: 250px;
    width: 100%;
    overflow: hidden;
  }
</style>
